Conditions | 5 |
Total Lines | 19 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { EventType } from './Event.entity'; |
||
37 | |||
38 | public getNumberOfMealTickets(itemsByDate: any[]): number { |
||
39 | let mealTicket = 0; |
||
40 | |||
41 | for (const sortedEvent of itemsByDate) { |
||
42 | let totalPerDay = 0; |
||
43 | |||
44 | for (const { time, type } of sortedEvent) { |
||
45 | if (type !== EventType.OTHER) { |
||
46 | totalPerDay += time; |
||
47 | } |
||
48 | } |
||
49 | |||
50 | if (totalPerDay > 0.5) { |
||
51 | mealTicket++; |
||
52 | } |
||
53 | } |
||
54 | |||
55 | return mealTicket; |
||
56 | } |
||
58 |